import request from '@/utils/request'

// 查询max group member count列表
export function listGroup(query) {
  return request({
    url: '/system/group/list',
    method: 'get',
    params: query
  })
}

// 查询max group member count详细
export function getGroup(id) {
  return request({
    url: '/system/group/' + id,
    method: 'get'
  })
}

// 新增max group member count
export function addGroup(data) {
  return request({
    url: '/system/group',
    method: 'post',
    data: data
  })
}

// 修改max group member count
export function updateGroup(data) {
  return request({
    url: '/system/group',
    method: 'put',
    data: data
  })
}

// 删除max group member count
export function delGroup(id) {
  return request({
    url: '/system/group/' + id,
    method: 'delete'
  })
}

// 查询群组成员列表
export function listGroupMembers(groupId) {
  return request({
    url: '/system/group/list/groupMember/' + groupId,
    method: 'get'
  })
}

// 设置群主
export function setGroupOwner(data) {
  return request({
    url: '/system/group/setOwner',
    method: 'post',
    data: data
  })
}

// 设置群管理员
export function setGroupAdmin(data) {
  return request({
    url: '/system/group/setAdmin',
    method: 'post',
    data: data
  })
}

// 群成员添加或删除（统一接口）
export function groupMemberAddOrDel(data) {
  return request({
    url: '/system/group/groupMemberAddOrDel',
    method: 'post',
    data: data
  })
}
